<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>商场消防云平台 - 登录</title>
    <style>
        /* 全局重置与基础设置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", sans-serif;
        }
        body {
            background: url('images/true.jpg') no-repeat center center/cover;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            color: #fff;
        }

        /* 登录容器：左右分栏布局 */
        .login-container {
            width: 900px;
            height: 500px;
            background: #fff;
            display: flex;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0,0,0,0.3);
        }

        /* 左侧表单区域 */
        .login-left {
            flex: 1;
            padding: 40px 50px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            color: #333; /* 改为深色，方便阅读 */
        }
        .login-left h1 {
            font-size: 28px;
            color: #00bfa5;
            margin-bottom: 30px;
        }

        /* 表单组通用样式 */
        .form-group {
            margin-bottom: 25px; /* 调整间距 */
        }
        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #666;
            font-size: 14px;
        }
        .form-group input {
            width: 100%;
            padding: 12px; /* 增加输入框高度 */
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        .form-group input:focus {
            border-color: #00bfa5;
            outline: none;
        }

        /* 错误提示 */
        .error-message {
            color: red;
            margin-bottom: 15px;
            display: ${errorMsg == null ? 'none' : 'block'};
        }

        /* 登录按钮 */
        .btn-login {
            width: 100%;
            padding: 12px;
            background: linear-gradient(to right, #00c853, #00bfa5);
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            margin-top: 10px;
            transition: opacity 0.3s;
        }
        .btn-login:hover {
            opacity: 0.9;
        }

        /* 辅助链接（注册按钮） */
        .register-btn {
            color: #00bfa5;
            text-decoration: none;
            font-weight: 500;
            padding: 6px 12px;
            border: 1px solid #00bfa5;
            border-radius: 4px;
            transition: all 0.3s;
            align-self: flex-start;
            margin-top: 10px;
        }
        .register-btn:hover {
            background-color: #00bfa5;
            color: white;
            text-decoration: none;
        }

        /* 右侧视觉区域 */
        .login-right {
            width: 45%;
            background: url('images/665bb057647420f.jpg') no-repeat center center/cover;
        }
    </style>
</head>
<body>
<div class="login-container">
    <!-- 左侧表单 -->
    <div class="login-left">
        <h1>商场消防云平台</h1>
        <%
            // 从 request 获取错误提示
            String errorMsg = (String) request.getAttribute("errorMsg");
            if (errorMsg != null) {
        %>
        <div class="error-message"><%= errorMsg %></div>
        <% } %>
        <form action="LoginServlet" method="post">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" placeholder="请输入用户名" required>
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" placeholder="请输入密码" required>
            </div>
            <button type="submit" class="btn-login">登录</button>
            <a href="register.jsp" class="register-btn">立即注册</a>
        </form>
    </div>
    <!-- 右侧背景图/视觉区 -->
    <div class="login-right"></div>
</div>
</body>
</html>